<?php
require(dirname(__FILE__)."/includes/init.php");
if(isset($_SESSION['user_name'])){
$pageNum = isset($_REQUEST['pageNum'])?$_REQUEST['pageNum']:1;
$email = isset($_REQUEST['specify'])?$_REQUEST['specify']:NULL;

$id = NULL;
$listArr = checkUnsubRate($id,$pageNum,$email);

?><title>退订列表</title>
<table width="1263" height="147" border="0" bgcolor="#0066FF" style="font-size:12px">
<form action="unsubRate.php" name="openRate" method="post">
  <tr bgcolor="#FFFFFF">
    <td>查询</td>
    <td colspan="3"><input name="specify" type="text" id="specify" size="35" />
        <input type="submit" name="Submit" value="提交" />     </td>
    <td colspan="2"><a href="/includes/clearUnsub.php" target="_blank">清理所有退订</a></td>
    <td colspan="4"><a href="showAllNotDeal.php" target="_blank">查看所有未清理的地址</a></td>
  </tr>
</form>  
  <tr bgcolor="#FFFFFF">
    <td width="69">id</td>
    <td width="254">address</td>
    <td width="84">addressId</td>
    <td width="98">ip</td>
    <td width="147">时间<span style=" background:#990000; color:#FFFFFF"><?php echo date("Y-m-d H:i:s",time());?></span></td>
    <td width="33">次数</td>
    <td width="369">用户浏览器</td>
    <td width="40">标记</td>
    <td width="40">分组</td>
    <td width="89">查看</td>
  </tr>
 <?php foreach($listArr as $key=>$value){?>   
  <tr bgcolor="#FFFFFF">
    <td><?php echo $value['id'];?></td>
    <td><?php echo $value['email'];?></td>
    <td><?php echo $value['emailId'];?></td>
    <td><?php echo $value['userIp'];?></td>
    <td><?php echo date("Y-m-d H:i:s",$value['timeStamps']);?></td>
    <td><?php echo $value['num'];?></td>
    <td><?php echo $value['userBrowser'];?></td>
    <td><?php if($value['flag']==0){echo "未清理";}else{echo "已清理";}?></td>
    <td><?php echo $value['type'];?></td>
    <td><a href="unsubRate.php?specify=<?php echo $value['email'];?>" target="_blank">查看</a></td>
  </tr>
 <?php }?> 
  <tr bgcolor="#FFFFFF">
    <td>&nbsp;</td>
    <td colspan="5"><?php $totalNum = getUnsubRateNum();
    $totalPage = ceil($totalNum[0]/$GLOBALS['pageSize']);
    $secondPage = $pageNum + $GLOBALS['yeMa'];
      for($i=1;$i<=$totalPage;$i++){
        echo "<<a href=\"unsubRate.php?pageNum=$i\">".$i."</a>>";
      }

	?></td>
    <td colspan="4">&nbsp;</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>&nbsp;</td>
    <td colspan="9"><?php include("includes/symbolic.htm");?></td>
  </tr>
</table>
<?php
}else{
 echo "hello";
}
?>